﻿
package system.data;

import java.util.*;

import framework.core.*;
/*
	Author    :Jackey
	CreateTime:2008-03-03 10:34:32
*/
public class InoutTypeBase extends Table 
{
public static final String TABLE_NAME = "T_INOUT_TYPE";

private static final String BACKUP_TABLE_NAME = "T_INOUT_TYPE_BACKUP";

private static final String BACKUP_SEQ_NAME = "S_INOUT_TYPE_BACKUP";


public static final String ID = "ID";

public static final String CODE = "CODE";

public static final String NAME = "NAME";

public static final String DISPLAY_ORDER = "DISPLAY_ORDER";

public static final String INOUT_TYPE = "INOUT_TYPE";

public static final String REMARK = "REMARK";

public static final String CREATE_USER_ID = "CREATE_USER_ID";

public static final String CREATE_USER = "CREATE_USER";

public static final String CREATE_TIME = "CREATE_TIME";

public static final String LAST_UPDATE_USER_ID = "LAST_UPDATE_USER_ID";

public static final String LAST_UPDATE_USER = "LAST_UPDATE_USER";

public static final String LAST_UPDATE_TIME = "LAST_UPDATE_TIME";


public static Vector m_fields = null;


private String m_id = ""; //序号

private String m_code = ""; //编码

private String m_name = ""; //名称

private int m_display_order = Value.NULL_INT;  //显示顺序

private String m_inout_type = ""; //出入库类别

private String m_remark = ""; //描述

private String m_create_user_id = ""; //创建用户序号

private String m_create_user = ""; //创建用户

private String m_create_time = ""; //单证创建时间

private String m_last_update_user_id = ""; //最后修改人序号

private String m_last_update_user = ""; //最后修改人

private String m_last_update_time = ""; //最后修改时间



	public String getId()
	{
	    return m_id;
	}
	public void  setId(String v)
	{
		if(getId().equals(v)) return ;
		m_id = v ;
		markDirty(ID);
	}



	

	public String getCode()
	{
	    return m_code;
	}
	public void  setCode(String v)
	{
		if(getCode().equals(v)) return ;
		m_code = v ;
		markDirty(CODE);
	}



	

	public String getName()
	{
	    return m_name;
	}
	public void  setName(String v)
	{
		if(getName().equals(v)) return ;
		m_name = v ;
		markDirty(NAME);
	}



	

	public int getDisplayOrder()
	{
	    return m_display_order;
	}
	public void  setDisplayOrder(int v)
	{
		if(getDisplayOrder()==v) return ;
		m_display_order = v ;
		markDirty(DISPLAY_ORDER);
	}



	

	public String getInoutType()
	{
	    return m_inout_type;
	}
	public void  setInoutType(String v)
	{
		if(getInoutType().equals(v)) return ;
		m_inout_type = v ;
		markDirty(INOUT_TYPE);
	}



	

	public String getRemark()
	{
	    return m_remark;
	}
	public void  setRemark(String v)
	{
		if(getRemark().equals(v)) return ;
		m_remark = v ;
		markDirty(REMARK);
	}



	

	public String getCreateUserId()
	{
	    return m_create_user_id;
	}
	public void  setCreateUserId(String v)
	{
		if(getCreateUserId().equals(v)) return ;
		m_create_user_id = v ;
		markDirty(CREATE_USER_ID);
	}



	

	public String getCreateUser()
	{
	    return m_create_user;
	}
	public void  setCreateUser(String v)
	{
		if(getCreateUser().equals(v)) return ;
		m_create_user = v ;
		markDirty(CREATE_USER);
	}



	

	public String getCreateTime()
	{
	    return m_create_time;
	}
	public void  setCreateTime(String v)
	{
		if(getCreateTime().equals(v)) return ;
		m_create_time = v ;
		markDirty(CREATE_TIME);
	}



	

	public String getLastUpdateUserId()
	{
	    return m_last_update_user_id;
	}
	public void  setLastUpdateUserId(String v)
	{
		if(getLastUpdateUserId().equals(v)) return ;
		m_last_update_user_id = v ;
		markDirty(LAST_UPDATE_USER_ID);
	}



	

	public String getLastUpdateUser()
	{
	    return m_last_update_user;
	}
	public void  setLastUpdateUser(String v)
	{
		if(getLastUpdateUser().equals(v)) return ;
		m_last_update_user = v ;
		markDirty(LAST_UPDATE_USER);
	}



	

	public String getLastUpdateTime()
	{
	    return m_last_update_time;
	}
	public void  setLastUpdateTime(String v)
	{
		if(getLastUpdateTime().equals(v)) return ;
		m_last_update_time = v ;
		markDirty(LAST_UPDATE_TIME);
	}



	



	public String viewId(DBConnection con) throws Exception
	{
		return Value.view(getId());
	}

	public String viewCode(DBConnection con) throws Exception
	{
		return Value.view(getCode());
	}

	public String viewName(DBConnection con) throws Exception
	{
		return Value.view(getName());
	}

	public String viewDisplayOrder(DBConnection con) throws Exception
	{
		return Value.view(getDisplayOrder());
	}

	public String viewInoutType(DBConnection con) throws Exception
	{
		return Value.view(getInoutType());
	}

	public String viewRemark(DBConnection con) throws Exception
	{
		return Value.view(getRemark());
	}

	public String viewCreateUserId(DBConnection con) throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewCreateUser(DBConnection con) throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateTime(DBConnection con) throws Exception
	{
		return Value.view(getCreateTime());
	}

	public String viewLastUpdateUserId(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUserId());
	}

	public String viewLastUpdateUser(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUser());
	}

	public String viewLastUpdateTime(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateTime());
	}



protected InoutTypeBase()
{
}

public void fill(InoutTypePageData pageData) throws Exception
{

	if(pageData.getId()!=null)
	{	
		setId(pageData.getId());
	}

	if(pageData.getCode()!=null)
	{	
		setCode(pageData.getCode());
	}

	if(pageData.getName()!=null)
	{	
		setName(pageData.getName());
	}

	if( pageData.getDisplayOrder()!=null && 
	   !pageData.getDisplayOrder().equals(""))
	{	
		setDisplayOrder(Integer.parseInt(pageData.getDisplayOrder()));
	}

	if(pageData.getInoutType()!=null)
	{	
		setInoutType(pageData.getInoutType());
	}

	if(pageData.getRemark()!=null)
	{	
		setRemark(pageData.getRemark());
	}

	if(pageData.getCreateUserId()!=null)
	{	
		setCreateUserId(pageData.getCreateUserId());
	}

	if(pageData.getCreateUser()!=null)
	{	
		setCreateUser(pageData.getCreateUser());
	}

	if(pageData.getCreateTime()!=null)
	{	
		setCreateTime(pageData.getCreateTime());
	}

	if(pageData.getLastUpdateUserId()!=null)
	{	
		setLastUpdateUserId(pageData.getLastUpdateUserId());
	}

	if(pageData.getLastUpdateUser()!=null)
	{	
		setLastUpdateUser(pageData.getLastUpdateUser());
	}

	if(pageData.getLastUpdateTime()!=null)
	{	
		setLastUpdateTime(pageData.getLastUpdateTime());
	}

}

public String getTableName() 
{
	return TABLE_NAME;
}

public String getBackupTableName() 
{
	return BACKUP_TABLE_NAME;
}

public String getBackupSeqName() 
{
	return BACKUP_SEQ_NAME;
}

public java.util.Vector getFields() 
{
	if(m_fields==null)
	{
		m_fields = new Vector();

		m_fields.add(new Field(ID,Value.TYPE_STRING,true,true,32,"序号"));

		m_fields.add(new Field(CODE,Value.TYPE_STRING,false,true,20,"编码"));

		m_fields.add(new Field(NAME,Value.TYPE_STRING,false,true,50,"名称"));

		m_fields.add(new Field(DISPLAY_ORDER,Value.TYPE_INT,false,false,0,"显示顺序"));

		m_fields.add(new Field(INOUT_TYPE,Value.TYPE_STRING,false,true,1,"出入库类别"));

		m_fields.add(new Field(REMARK,Value.TYPE_STRING,false,false,200,"描述"));

		m_fields.add(new Field(CREATE_USER_ID,Value.TYPE_STRING,false,true,32,"创建用户序号"));

		m_fields.add(new Field(CREATE_USER,Value.TYPE_STRING,false,false,50,"创建用户"));

		m_fields.add(new Field(CREATE_TIME,Value.TYPE_STRING,false,false,20,"单证创建时间"));

		m_fields.add(new Field(LAST_UPDATE_USER_ID,Value.TYPE_STRING,false,true,32,"最后修改人序号"));

		m_fields.add(new Field(LAST_UPDATE_USER,Value.TYPE_STRING,false,false,50,"最后修改人"));

		m_fields.add(new Field(LAST_UPDATE_TIME,Value.TYPE_STRING,false,false,20,"最后修改时间"));
		
	}
	return m_fields;
}

public void initObject(java.sql.ResultSet rs) throws Exception
{

	m_id = getString(rs,ID);

	m_code = getString(rs,CODE);

	m_name = getString(rs,NAME);

	m_display_order = getInt(rs,DISPLAY_ORDER);

	m_inout_type = getString(rs,INOUT_TYPE);

	m_remark = getString(rs,REMARK);

	m_create_user_id = getString(rs,CREATE_USER_ID);

	m_create_user = getString(rs,CREATE_USER);

	m_create_time = getString(rs,CREATE_TIME);

	m_last_update_user_id = getString(rs,LAST_UPDATE_USER_ID);

	m_last_update_user = getString(rs,LAST_UPDATE_USER);

	m_last_update_time = getString(rs,LAST_UPDATE_TIME);

	ms_new_flag = ConstDefine.NO;
}

public Value get(String f)
{

	if(f.equalsIgnoreCase(ID))
	{
		return new Value(getId());
	}

	if(f.equalsIgnoreCase(CODE))
	{
		return new Value(getCode());
	}

	if(f.equalsIgnoreCase(NAME))
	{
		return new Value(getName());
	}

	if(f.equalsIgnoreCase(DISPLAY_ORDER))
	{
		return new Value(getDisplayOrder());
	}

	if(f.equalsIgnoreCase(INOUT_TYPE))
	{
		return new Value(getInoutType());
	}

	if(f.equalsIgnoreCase(REMARK))
	{
		return new Value(getRemark());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		return new Value(getCreateUserId());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		return new Value(getCreateUser());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		return new Value(getCreateTime());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		return new Value(getLastUpdateUserId());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		return new Value(getLastUpdateUser());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_TIME))
	{
		return new Value(getLastUpdateTime());
	}
	
	return null;
}
public void set(String f,Value v) throws Exception
{

	if(f.equalsIgnoreCase(ID))
	{
		setId(v.getString());
	}

	if(f.equalsIgnoreCase(CODE))
	{
		setCode(v.getString());
	}

	if(f.equalsIgnoreCase(NAME))
	{
		setName(v.getString());
	}

	if(f.equalsIgnoreCase(DISPLAY_ORDER))
	{
		setDisplayOrder(v.getInt());
	}

	if(f.equalsIgnoreCase(INOUT_TYPE))
	{
		setInoutType(v.getString());
	}

	if(f.equalsIgnoreCase(REMARK))
	{
		setRemark(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		setCreateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		setCreateUser(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		setCreateTime(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		setLastUpdateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		setLastUpdateUser(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_TIME))
	{
		setLastUpdateTime(v.getString());
	}
	
}
public String toString()
{
	String msg = "InoutType=\n";
	msg += "(\r\n";

	msg += "    序号(id)="+get("id")+"\r\n";

	msg += "    编码(code)="+get("code")+"\r\n";

	msg += "    名称(name)="+get("name")+"\r\n";

	msg += "    显示顺序(display_order)="+get("display_order")+"\r\n";

	msg += "    出入库类别(inout_type)="+get("inout_type")+"\r\n";

	msg += "    描述(remark)="+get("remark")+"\r\n";

	msg += "    创建用户序号(create_user_id)="+get("create_user_id")+"\r\n";

	msg += "    创建用户(create_user)="+get("create_user")+"\r\n";

	msg += "    单证创建时间(create_time)="+get("create_time")+"\r\n";

	msg += "    最后修改人序号(last_update_user_id)="+get("last_update_user_id")+"\r\n";

	msg += "    最后修改人(last_update_user)="+get("last_update_user")+"\r\n";

	msg += "    最后修改时间(last_update_time)="+get("last_update_time")+"\r\n";
		
	msg += ")\r\n";
	return msg;
}
public void copyBase(InoutTypeBase srcObj)
{

	setId(srcObj.getId());

	setCode(srcObj.getCode());

	setName(srcObj.getName());

	setDisplayOrder(srcObj.getDisplayOrder());

	setInoutType(srcObj.getInoutType());

	setRemark(srcObj.getRemark());

	setCreateUserId(srcObj.getCreateUserId());

	setCreateUser(srcObj.getCreateUser());

	setCreateTime(srcObj.getCreateTime());

	setLastUpdateUserId(srcObj.getLastUpdateUserId());

	setLastUpdateUser(srcObj.getLastUpdateUser());

	setLastUpdateTime(srcObj.getLastUpdateTime());

}

public String toXml() throws Exception
{
	String xml = "";
	xml += "<InoutType>";

	xml += "<Id>"+Value.view(getId())+"</Id>";

	xml += "<Code>"+Value.view(getCode())+"</Code>";

	xml += "<Name>"+Value.view(getName())+"</Name>";

	xml += "<DisplayOrder>"+Value.view(getDisplayOrder())+"</DisplayOrder>";

	xml += "<InoutType>"+Value.view(getInoutType())+"</InoutType>";

	xml += "<Remark>"+Value.view(getRemark())+"</Remark>";

	xml += "<CreateUserId>"+Value.view(getCreateUserId())+"</CreateUserId>";

	xml += "<CreateUser>"+Value.view(getCreateUser())+"</CreateUser>";

	xml += "<CreateTime>"+Value.view(getCreateTime())+"</CreateTime>";

	xml += "<LastUpdateUserId>"+Value.view(getLastUpdateUserId())+"</LastUpdateUserId>";

	xml += "<LastUpdateUser>"+Value.view(getLastUpdateUser())+"</LastUpdateUser>";

	xml += "<LastUpdateTime>"+Value.view(getLastUpdateTime())+"</LastUpdateTime>";
	
	xml += "</InoutType>";
	return xml;
}

}
